fix platform api build oom#66
Conversation
Greptile SummaryThis PR fixes an OOM crash during the
Confidence Score: 4/5Safe to merge — the change is small and targeted, correctly relocating the heap limit so it applies regardless of how the build is invoked. The memory limit is now baked into the sub-package's build script, which is the right place for it and fixes the OOM for all callers. The only minor concern is the path node_modules/typescript/bin/tsc — while it works under pnpm's symlink layout, ./node_modules/.bin/tsc is the more portable and conventional choice. Only client-sdks/platform/typescript/package.json needs a second look for the binary path convention; package.json is straightforward cleanup.
|
| Filename | Overview |
|---|---|
| client-sdks/platform/typescript/package.json | Build script changed from plain tsc to node --max-old-space-size=8192 node_modules/typescript/bin/tsc to embed the 8 GB heap limit directly in the package; path resolves via pnpm symlink but is non-standard compared to ./node_modules/.bin/tsc. |
| package.json | Removes NODE_OPTIONS=--max-old-space-size=8192 from the generate:platform-api root script now that the limit lives inside the sub-package's own build script. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["pnpm run generate:platform-api (root)"] --> B["speakeasy generate sdk"]
B --> C["pnpm -C client-sdks/platform/typescript build"]
C --> D["node --max-old-space-size=8192 node_modules/typescript/bin/tsc"]
E["turbo build (root)"] --> C
F["pnpm build (inside sub-package)"] --> D
style D fill:#90EE90,stroke:#228B22
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
client-sdks/platform/typescript/package.json:55
Using `node_modules/typescript/bin/tsc` reaches directly into the package's internal directory tree. The conventional and more portable path is `./node_modules/.bin/tsc` — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared `devDependencies`, and it doesn't depend on TypeScript keeping `bin/tsc` at that exact internal path.
```suggestion
"build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc",
```
Reviews (1): Last reviewed commit: "fix: increase platform api build heap" | Re-trigger Greptile
| "scripts": { | ||
| "lint": "eslint --cache --max-warnings=0 src", | ||
| "build": "tsc", | ||
| "build": "node --max-old-space-size=8192 node_modules/typescript/bin/tsc", |
There was a problem hiding this comment.
Using
node_modules/typescript/bin/tsc reaches directly into the package's internal directory tree. The conventional and more portable path is ./node_modules/.bin/tsc — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared devDependencies, and it doesn't depend on TypeScript keeping bin/tsc at that exact internal path.
| "build": "node --max-old-space-size=8192 node_modules/typescript/bin/tsc", | |
| "build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: client-sdks/platform/typescript/package.json
Line: 55
Comment:
Using `node_modules/typescript/bin/tsc` reaches directly into the package's internal directory tree. The conventional and more portable path is `./node_modules/.bin/tsc` — this is the symlink every package manager (npm, pnpm, yarn) guarantees to create for declared `devDependencies`, and it doesn't depend on TypeScript keeping `bin/tsc` at that exact internal path.
```suggestion
"build": "node --max-old-space-size=8192 ./node_modules/.bin/tsc",
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.